package com.sangmo.fts.process.factoring.service;

import com.sangmo.boot.framework.plugin.dataview.crud.service.BaseViewService;
import com.sangmo.boot.framework.plugin.dataview.data.IDataViewRepo;
import com.sangmo.fts.process.factoring.model.FfContractItem;
import com.sangmo.fts.process.factoring.repo.FfContractItemRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class FfContractItemEntityService extends BaseViewService<FfContractItem> {

    @Autowired
    private FfContractItemRepo ffContractItemRepo;

    @Override
    protected IDataViewRepo<FfContractItem> getRepo() {
        return ffContractItemRepo;
    }

    public List<FfContractItem> saveAll(List<FfContractItem> contractItems) {
        return ffContractItemRepo.saveAll(contractItems);
    }

    List<FfContractItem> findByContractId(Long contractId) {
        return ffContractItemRepo.findByContractId(contractId);
    }
}
